<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/template/interiorTemplate.xhtml">
	<ui:define name="titulo">
		<f:metadata>
			<f:viewParam name="album" value="#{albumManagedBean.album}" converter="albumConversor" />
		</f:metadata>
                <h:outputLabel value="MusicBay - #{msg.album}"/>
        </ui:define>

	<ui:define name="img">
		<p:panel>
			<h:link outcome="artistaPage" id="artistaPage">
				<p:graphicImage url="/faces/image?id=#{albumManagedBean.album.artista.idArtista}&amp;tipo=a"
					width="220" height="220" styleClass="imgEdit" />
				<f:param name="artista" value="#{albumManagedBean.album.artista.idArtista}" />
			</h:link>
		</p:panel>
	</ui:define>

	<ui:define name="gen">
		<p:panel styleClass="text">
			<h:outputText value="#{albumManagedBean.album.artista.descricao}" />
		</p:panel>
	</ui:define>


	<ui:define name="cont">
		<div id="contCenter">
			<div id="art">
				<h:outputLabel value="#{albumManagedBean.album.artista.nome}" />
			</div>
			<div id="alb">
				<h:outputLabel value="#{albumManagedBean.album.nome}" />
			</div>
			<div id="blocP">
				<h:form>
					<p:dataTable id="datatable" var="musica" value="#{albumManagedBean.musicaDataModel}"
						emptyMessage="#{msg.nenhumItem}" rows="20"
						selection="#{musicaManagedBean.musicasSelect}" sortBy="#{musica.faixa}" styleClass="table">

						<p:column headerText="#{msg.faixa}">
							<h:outputText value="#{musica.faixa} #" />
						</p:column>

						<p:column headerText="#{msg.duracao}" id="duracao">
							<h:outputText value="#{musica.duracao} ss" />
						</p:column>

						<p:column headerText="#{msg.titulo}">
							<h:outputText value="#{musica.nome} " />
						</p:column>
					</p:dataTable>
				</h:form>
			</div>
		</div>
	</ui:define>


	<ui:define name="img2">
		<p:panel>
			<p:graphicImage url="/faces/image?id=#{albumManagedBean.album.idAlbum}&amp;tipo=u" width="220"
				height="220" styleClass="imgEdit" title="#{albuns.nome}" />
		</p:panel>
	</ui:define>

	<ui:define name="sobre">
		<p:panel>
			<h:panelGrid columns="2" width="250" styleClass="tableAlbum">
				<h:outputLabel value="#{msg.titulo}" styleClass="label" />
				<h:outputText value="#{albumManagedBean.album.nome}" />

				<h:outputLabel value="#{msg.ano}" styleClass="label" />
				<h:outputText value="#{albumManagedBean.album.ano}" />

				<h:outputLabel value="#{msg.genero}" styleClass="label" />
				<h:panelGroup>
					<ui:repeat var="gen" value="#{albumManagedBean.album.artista.generos}">
						<h:outputText value="#{gen.genero}" styleClass="genero2" />
					</ui:repeat>
				</h:panelGroup>
			</h:panelGrid>
		</p:panel>
	</ui:define>

	<ui:define name="listaAlbuns">
		<p:panel>
			<ui:repeat var="albuns" value="#{albumManagedBean.album.artista.albuns}">
				<h:link outcome="albumPage" id="albumPage" rendered="#{albuns != albumManagedBean.album}">
					<p:graphicImage url="/faces/image?id=#{albuns.idAlbum}&amp;tipo=u" width="100" height="100"
						styleClass="imgEditEx" title="#{albuns.nome}" />
					<f:param name="album" value="#{albuns.idAlbum}" />
				</h:link>
			</ui:repeat>
		</p:panel>
	</ui:define>
</ui:composition>
</html>